
*********************************************************************************
*** External Threat and Human Rights Replication ********************************
*********************************************************************************


 use "Replication.dta", replace 

 xtset ccode year


 * Replicating Figure 1
  
  hist ln_index if ln_index!=0
 
 * Replicating Figure 2
 
 
 gr twoway line  ln_index year if ccode==666, name(g1, replace) nodraw title("Israel") ytitle("Threat") xtitle("Year") 
 gr twoway line  ln_index year if ccode==652, name(g2, replace) nodraw title("Syria") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==2,   name(g6, replace) nodraw title("United States") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==710, name(g8, replace) nodraw title("China") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==365, name(g7, replace) nodraw title("USSR/Russia") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==731, name(g3, replace) nodraw title("North Korea") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==732, name(g4, replace) nodraw title("South Korea") ytitle("Threat") xtitle("Year")
 gr twoway line  ln_index year if ccode==816, name(g5, replace) nodraw title("Vietnam") ytitle("Threat") xtitle("Year")
 gr twoway line  ln_index year if ccode==490, name(g9, replace) nodraw title("DR of Congo") ytitle("Threat") xtitle("Year")
 gr twoway line  ln_index year if ccode==750, name(g10, replace) nodraw title("India") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==770, name(g11, replace) nodraw title("Pakistan") ytitle(" ") xtitle("Year")
 gr twoway line  ln_index year if ccode==93, name(g12, replace) nodraw title("Nicaragua") ytitle(" ") xtitle("Year")

 graph combine g1 g2 g3 g4 g5 g6 g7 g8 g9 g10 g11 g12, ycommon name(combined, replace) 
  

 * Replicating Main Statistical Results and Figures 3 and 4



xtologit additive ln_index polity2  civil  ln_pop ln_gdp_pc lagged_ciri_0 lagged_ciri_1 lagged_ciri_2 lagged_ciri_3 lagged_ciri_4 lagged_ciri_5 lagged_ciri_6 lagged_ciri_7 lagged_ciri_8, vce(robust) or
estimates store A

xtologit disap ln_index polity2  civil ln_pop ln_gdp_pc lagged_disap_0 lagged_disap_1 lagged_disap_2 , vce(robust) or
estimates store D

xtologit kill ln_index polity2  civil ln_pop ln_gdp_pc lagged_kill_0 lagged_kill_1 lagged_kill_2, vce(robust) or
estimates store K

xtologit polpris ln_index polity2  civil ln_pop ln_gdp_pc lagged_polpris_0 lagged_polpris_1 lagged_polpris_2, vce(robust) or
estimates store P

xtologit tort ln_index polity2  civil ln_pop ln_gdp_pc lagged_tort_0 lagged_tort_1 lagged_tort_2, vce(robust) or
estimates store T

xtologit speech ln_index polity2 civil ln_pop ln_gdp_pc lagged_speech_0 lagged_speech_1 lagged_speech_2 , vce(robust) or
estimates store S

xtologit assn ln_index polity2  civil ln_pop ln_gdp_pc lagged_association_0 lagged_association_1 lagged_association_2 , vce(robust) or
estimates store AS

xtologit dommov ln_index polity2  civil ln_pop ln_gdp_pc lagged_dommov_0 lagged_dommov_1 lagged_dommov_2 , vce(robust) or
estimates store DM

xtologit formov ln_index polity2 civil ln_pop ln_gdp_pc lagged_formov_0 lagged_formov_1 lagged_formov_2 , vce(robust) or
estimates store FM


 coefplot A, bylabel(Additive Index)   ///
      || D, bylabel(Disappearances)  ///
	  || K, bylabel(Extrajudicial Killings) ///
	  || T, bylabel(Torture) ///
	  || P, bylabel(Political Imprisonment) ///
      ||, keep(ln_index polity2 civil ln_pop ln_gdp_pc) ///
	  xline(1) xtitle(Odds Ratio) eform levels(95) grid(none) msymbol(o) mfcolor(black) xlabel(0(.5)3) byopts(compact cols(1)) 

	  
 coefplot    S, bylabel(Freedom of Speech) ///
		|| AS, bylabel (Freedom of Association) ///
		|| DM, bylabel(Domestic Movement) ///
		|| FM, bylabel (Foreign Movement) ///
        ||, keep(ln_index polity2 civil ln_pop ln_gdp_pc) ///
	    xline(1) xtitle(Odds Ratio) eform levels(95) grid(none) msymbol(o) mfcolor(black) xlabel(0(.5)3) byopts(compact cols(1)) 
		
